package com.zone.infrastructure.persistent.dao;

import com.zone.infrastructure.persistent.po.RaffleActivityAccountMonth;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author: zongzi
 * @description: 抽奖活动账户表-月次数
 * @date: 2025/2/17
 */
@Mapper
public interface IRaffleActivityAccountMonthDao {

    RaffleActivityAccountMonth get(@Param("userId") String userId, @Param("activityId") Long activityId, @Param("month") String month);

    int update(RaffleActivityAccountMonth raffleActivityAccountMonth);

    void insert(RaffleActivityAccountMonth raffleActivityAccountMonth);

    /**
     * 扣减月剩余次数
     *
     * @param userId
     * @param activityId
     * @param month
     * @return
     */
    int decrCountSurplus(@Param("userId") String userId, @Param("activityId") Long activityId, @Param("month") String month);
}
